package com.hsm5;

import java.util.Comparator;

public class TestCompareTo2 {
    public static void main(String[] args) {
        Student s1 = new Student(20,"hsm",165.12);
        Student s2 = new Student(22,"cy",179.99);
        //获取比较器
        Comparator c1 = new BiJiao1(); //多态 接口接收比较类
        Comparator c2 = new BiJiao2();
        Comparator c3 = new BiJiao3();
        System.out.println(c1.compare(s1,s2));
        System.out.println(c2.compare(s1,s2));
        System.out.println(c3.compare(s1,s2));
    }
}